package com.yike.product.service;

import com.yike.common.base.BaseService;
import com.yike.common.pagination.Paging;
import com.yike.product.entity.Goods;
import com.yike.product.param.*;
import com.yike.product.vo.*;

import java.util.List;

/**
 * 商品表 服务类
 *
 * @author yike
 * @since 2024-07-17
 */
public interface GoodsService extends BaseService<Goods> {

    /**
     * 保存
     *
     * @param goods
     * @return
     * @throws Exception
     */
    boolean saveGoods(AddGoodsParam goods) throws Exception;

    /**
     * 修改
     *
     * @param goods
     * @return
     * @throws Exception
     */
    boolean updateGoods(UpdateGoodsParam goods) throws Exception;

    /**
     * 删除
     *
     * @param id
     * @return
     * @throws Exception
     */
    boolean deleteGoods(Long id) throws Exception;


    /**
     * 获取分页对象
     *
     * @param goodsPageParam
     * @return
     * @throws Exception
     */
    Paging<GoodsVo> getGoodsPageList(GoodsPageParam goodsPageParam) throws Exception;

    /**
     * 客户扫码-条码查询接口
     *
     * @param barcode
     * @return
     */
    GoodsCustomVo getByBarcode(String barcode);

    GoodsVo getGoods(Long id);

    /**
     * 商户扫码获取商品-用于添加
     *
     * @param param
     * @return
     */
    GoodsShopVo getByBarcodeForShop(String param) throws Exception;

    /**
     * 客户端商品查询
     * @param param
     * @return
     */
    Paging<GoodsCustomVo> getGoodsCustomPageList(GoodsCustomPageParam param);

    Paging<GoodsListVo> getShopGoodsList(ShopGoodsPageParam shopGoodsPageParam) throws Exception;

    List<String> getShopGoodsSearchData(String keyword) throws Exception;
}
